]> git.r.bdr.sh - rbdr/captura/blame - Captura/Core Extensions/CVImageBuffer+cgImage.swift
Adds configure support for URLs
[rbdr/captura] / Captura / Core Extensions / CVImageBuffer+cgImage.swift
CommitLineData
c9b9e1d6
RBR
1import Foundation
2import ReplayKit
3
4extension CVImageBuffer {
5
6 var cgImage: CGImage? {
7 let ciImage = CIImage(cvImageBuffer: self)
8 let context = CIContext()
9 return context.createCGImage(ciImage, from: CGRect(x: 0, y: 0, width: CVPixelBufferGetWidth(self), height: CVPixelBufferGetHeight(self)))
10 }
11}